#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QSound>

MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    ui->setupUi(this);

    //实例化对象
    QSound* sound = new QSound(":/wav/1.wav", this);

    connect(ui->pushButton, &QPushButton::clicked, this, [=](){
        //播放
        sound->play();
    });
}

MainWindow::~MainWindow()
{
    delete ui;
}
